// 是否为回文数判断、
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main()
{
    long long test;
    cout << "请输入数字：" << endl;
    cin >> test;

    string s = to_string(test);

    if (s.substr(0, 1) == "-")
        s = s.erase(0, 1);

    int cishu = s.length();
    cout << test << "的位数是：" << cishu << endl;

    vector<int> p;
    for (int i = 0; i < cishu; i++)
    {
        p.push_back(stoi(s.substr(i, 1)));
    }

    int c2 = 0;
    for (int i = 0; i < int(cishu / 2); i++)
    {
        if (p[i] == p[cishu - i - 1])
        {
            c2++;
        }
        else
            break;
    }

    if (c2 == int(cishu / 2))
    {
        cout << test << "是回文数" << endl;
    }
    else
        cout << test << "不是回文数" << endl;
}